import request from '@/utils/request'

// 查询计量清单列表
export function listMeterage(query) {
  return request({
    url: '/project/meterage/list',
    method: 'get',
    params: query
  })
}

// 查询计量清单详细
export function getMeterage(meterageBoqId) {
  return request({
    url: '/project/meterage/' + meterageBoqId,
    method: 'get'
  })
}

// 新增计量清单
export function addMeterage(data) {
  return request({
    url: '/project/meterage',
    method: 'post',
    data: data
  })
}

// 修改计量清单
export function updateMeterage(data) {
  return request({
    url: '/project/meterage',
    method: 'put',
    data: data
  })
}

// 删除计量清单
export function delMeterage(meterageBoqId) {
  return request({
    url: '/project/meterage/' + meterageBoqId,
    method: 'delete'
  })
}

// 清空计量清单
export function clean(data) {
  return request({
    url: '/project/meterage/clean',
    method: 'post',
    params: data
  })
}

// 下载计量清单模板
export function importTemplate() {
  return request({
    url: '/project/meterage/importTemplate',
    method: 'get'
  })
}

// 生成计量清单
export function generateMeterage(data) {
  return request({
    url: '/project/meterage/generate',
    method: 'post',
    params: data
  })
}

// 导入前验证
export function beforeImportValidate(data) {
  return request({
    url: '/project/meterage/beforeImportValidate',
    method: 'post',
    params: data
  })
}

// 获取剩余数量
export function getRemainderAmount(data) {
  return request({
    url: '/project/meterage/getRemainderAmount',
    method: 'post',
    params: data
  })
}
